package com.yang;

import com.test.User;
import lombok.extern.java.Log;

import java.lang.reflect.Field;
import java.util.logging.Logger;
@Log
public class Main {
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        System.out.println("Hello world!");
        User ming = new User("ming", 18);
        System.out.println(ming);
        Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
        System.out.println(logger.getName());

        //反射操作
        User a = new User("AAA", 18);
        Class<User> userClass = User.class;
        Field name = userClass.getDeclaredField("name");
        name.setAccessible(true);
        System.out.println(name.get(a));

        log.info("hello world!");
    }
}